"use client"; import { UserInfoRep, UserVipInfo, Wallet } from "@/api/user"; import { Link } from "@/i18n"; import { percentage } from "@/utils/methods"; import { ProgressBar } from "antd-mobile"; import { useTranslations } from "next-intl"; import Image from "next/image"; import { Fragment, useState } from "react"; import MaskCom from "./component/MaskCom"; const vipImages = [ { leve: 1, src: "/vip/1.png", color: "#686868" }, { leve: 2, src: "/vip/2-3-4.png", color: "#844C4F" }, { leve: 3, src: "/vip/2-3-4.png", color: "#844C4F" }, { leve: 4, src: "/vip/2-3-4.png", color: "#844C4F" }, { leve: 5, src: "/vip/5-6-7.png", color: "#707386" }, { leve: 6, src: "/vip/5-6-7.png", color: "#707386" }, { leve: 7, src: "/vip/5-6-7.png", color: "#707386" }, { leve: 8, src: "/vip/8-9-10.png", color: "#894622" }, { leve: 9, src: "/vip/8-9-10.png", color: "#894622" }, { leve: 10, src: "/vip/8-9-10.png", color: "#894622" }, ]; type Props = { userInfo: UserInfoRep; userMoney: Wallet; userVip: UserVipInfo; }; export const ProfileHeader = (props: Props) => { const { userInfo, userMoney, userVip } = props; const t = useTranslations("ProfilePage"); const [visible, setVisible] = useState(false); const callbackFun = () => { setVisible(!visible); }; // Vip 图标 const vipIconElement = vipImages.map((item, index) => { if (item.leve === userVip.vip_level) { return ( {"vip"} {item.leve} ); } }); return ( <>
{t("Conta")} {userInfo?.user_phone || ""}
{/*vipcard*/}
{vipIconElement}
{/*
{userVip.vip_exp}xp
*/}
VIP{userVip.vip_level} {t("expTips", { exp: userVip.vip_score_exp - userVip.vip_exp, })} VIP {userVip.vip_next_level}
{t("Saldo")}
brl {userMoney.Score || 0.0}
setVisible(true)}> {t("Bônus")}{" "} question
brl {userMoney.point || 0.0}
{t("Depósito")} {t("Sacar")}
); };